﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace FinanceTool.Data
{
    public abstract class CsvReader : IDataReader
    {
        private StreamReader _sr;

        public string FileLocation { get; set; }

        public abstract string SourceSystem { get; }

        public abstract string Delimiter { get; }

        public bool EndOfStream
        {
            get { return _sr.EndOfStream; }
        }

        public CsvReader(string fileLocation)
        {
            FileLocation = fileLocation;
            _sr = new StreamReader(FileLocation);
        }


        public string ReadLine()
        {
            return _sr.ReadLine();
        }

        public void Close()
        {
            _sr.Close();
        }

        public void Dispose()
        {
            _sr.Dispose();
        }

        void IDisposable.Dispose()
        {
            Dispose();
        }
    }
}
